package org.activiti.explorer.servlet.explorer;

import org.activiti.explorer.servlet.ExplorerApplicationServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

//@Configuration
//@ComponentScan({
//    "org.activiti.rest.editor", 
//    "org.activiti.rest.diagram",
//    })
//@EnableAsync
public class ExplorerServletConfiguration extends WebMvcConfigurationSupport {

  private final Logger log = LoggerFactory.getLogger(ExplorerServletConfiguration.class);

  @Bean(name="ExplorerApplicationServlet")
  public ServletRegistrationBean explorerApplicationServlet(){
      ServletRegistrationBean bean = new ServletRegistrationBean();
      bean.setName("ExplorerApplicationServlet");
      bean.setServlet(new ExplorerApplicationServlet());
      bean.addUrlMappings("/ui/*","/VAADIN/*");
      bean.addInitParameter("widgetset", "org.activiti.explorer.CustomWidgetset");
      return bean;
  }
  
}
